I'd like to discuss a bug that caused a mysterious log breakdown.
summary
I had a bug that I didn't understand, so I asked for help with a problem.
The initially perceived "log breakdown" turned out to be an incorrect perception of the phenomenon.
Correct: "The log splits into two conversations."
It's a relief to know that the logs haven't been lost.
nisbot.iconWhat would you like to see happen in this conversation?
nishio.iconI'd like to discuss a bug that caused a mysterious log breakdown.
nisbot.iconWhat kind of "bug" is this "bug"?
nishio.iconThe first few lines of the log were lost. Even the data stored on the server lost the beginning of the log.
nisbot.iconWhat kind of "log" is that "log"?
nishio.iconConversation Log. A list of what the user typed into the chat and what the bot responded to.
nisbot.iconIs there anything else about that "log"?
nishio.iconIn the first place, the server is supposed to send a single line of statements to the server, and the server side is supposed to do the postscript, so it's puzzling why it breaks off in the middle of the statement.
nisbot.icon
Conversation logs. A list of what the user typed into the chat and what the bot responded to.
Where is this "log" located?
nishio.iconon the server.
nisbot.iconWhat kind of "server" is this "server"?
nishio.iconReceive a string on Heroku and return a reply response. The status is stored in Firestore.
nisbot.iconWhat kind of "save" is that "save"?
nishio.iconThe KVS is keyed to the talk ID, and the internal state necessary to continue the conversation is converted to JSON and stored there. JSON is the historical background, and when actually used, it is necessary to convert it into a form that can be entered into the Firestore before saving it.
nisbot.iconWhat is it that you value?
nishio.iconI would like to see the bugs worked out. Losing logs is a loss, and I can't use it safely if I think it might be lost. I've tried a few quick and suspicious operations, but I can't reproduce them and I'm having a hard time keeping my head above water.
nisbot.iconWhere is that "log" located?
nishio.iconFirestore.
nisbot.icon
I would like to see the bug resolved. Losing logs is a loss, and I can't use it with confidence if I think it might be lost. I've tried a few quick and suspicious operations, but I can't reproduce them, and I'm having a hard time keeping my head above water.
What does this "log" look like?
nishio.iconFiles to be appended. If the log disappears, you'd think it was overwritten, but it's inexplicable that it disappears because it should have been loaded, added, and written back in the first place.
nisbot.iconWhere do these "logs" come from?
nishio.iconLet's see, the feature that I think is suspicious this time is the "open and continue past conversations" feature that I recently added, and I was using it all the time when the logs actually disappeared. When I used this feature, I first accessed Firestore with the conversation ID in the browser's IndexedDB to retrieve the past logs and display them.
nisbot.iconHow do you know its "log"?
nishio.iconI'll send the conversation ID to Firestore and say, "Give me the log of this conversation."
nisbot.iconWhat would you like to see happen with respect to that "log"?
nishio.iconI wish it would not disappear, or at least know how to reproduce the disappearing phenomenon. If you can't reproduce it, you can't debug it.
nisbot.iconWhat needs to happen to the "log" for that to happen?
nishio.iconI don't know!
nisbot.icon
I'll send the conversation ID to Firestore and say, "Give me the log of this conversation."
What kind of "Firestore" is this "Firestore"?
nishio.iconJust a KVS on a server
nisbot.iconIs there anything else about that "server"?
nishio.iconI have a script that downloads the values on the server locally to make it easier to investigate, and I did see that the beginning of the log in question was broken using that, but then a few other things were downloaded. I should also see what kind of data those are.
nisbot.iconHow do you know its "server"?
nishio.iconThat's the best way to know what the servers are up to.
nisbot.iconWhere is this "server" located?
nishio.iconI'm going to go observe a local copy.
nisbot.icon
That's the best way to know what's going on with the servers.
What do you hope will happen regarding this "server"?
nishio.iconOkay, the log isn't missing, it's split into two conversations.
nisbot.iconWhat kind of "conversation" is that "conversation"?
nishio.iconIn other words, I thought I was having one conversation, but some kind of malfunction or something caused me to start another new conversation in the middle of the first one.
nisbot.iconIs there anything else about that "conversation"?
nishio.iconI just looked at the list of past conversations saved in my browser, and sure enough, there were two conversations. I didn't notice that, and I displayed the log at the time the second conversation ended, so only the log of the second half of the conversation was displayed, and I thought, "The first half is lost? I guess I misunderstood. I could see the log of the first half without any problem.
nisbot.iconHow do you know its a "conversation"?
nishio.iconGood thing I added the past conversation list feature. You can see it there.
nisbot.iconWhat does that "conversation" sound like?
nishio.iconUnlike verbal conversations, which can be erased, I think it's important to keep a log and be able to read it back later. So it's a written image. That's why I was so worried when I heard, "The log is gone? but I am relieved to know that it has not disappeared for the time being.
nisbot.iconWhere does this "conversation" come from?
---
This page is auto-translated from /nishio/謎のログが途切れるバグが起きたので相談したい. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.